
CTYPE_BUILD_PATH	=	ctype/build
F_MATH_BUILD_PATH	=	f_math/build
MATH_BUILD_PATH		=	math/build
STDIO_BUILD_PATH	=	stdio/build
STDLIB_BUILD_PATH	=	stdlib/build
STRING_BUILD_PATH	=	string/build

CTYPE_MAKEFILE		=	ctype.mak
F_MATH_MAKEFILE		=	f_math.mak
MATH_MAKEFILE		=	math.mak
STDIO_MAKEFILE		=	stdio.mak
STDLIB_MAKEFILE		=	stdlib.mak
STRING_MAKEFILE		=	string.mak

all:
	cd $(CTYPE_BUILD_PATH) && make -f $(CTYPE_MAKEFILE)
	cd $(F_MATH_BUILD_PATH) && make -f $(F_MATH_MAKEFILE)
	cd $(MATH_BUILD_PATH) && make -f $(MATH_MAKEFILE)
	cd $(STDIO_BUILD_PATH) && make -f $(STDIO_MAKEFILE)
	cd $(STDLIB_BUILD_PATH) && make -f $(STDLIB_MAKEFILE)
	cd $(STRING_BUILD_PATH) && make -f $(STRING_MAKEFILE)
	rm -f ../../../../Lib/C33/libc.a
	cp lib/libc.a ../../../../Lib/C33/

clean:
	cd $(CTYPE_BUILD_PATH) && make -f $(CTYPE_MAKEFILE) clean
	cd $(F_MATH_BUILD_PATH) && make -f $(F_MATH_MAKEFILE) clean
	cd $(MATH_BUILD_PATH) && make -f $(MATH_MAKEFILE) clean
	cd $(STDIO_BUILD_PATH) && make -f $(STDIO_MAKEFILE) clean
	cd $(STDLIB_BUILD_PATH) && make -f $(STDLIB_MAKEFILE) clean
	cd $(STRING_BUILD_PATH) && make -f $(STRING_MAKEFILE) clean

rebuild: clean all

